﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model;
using HengTong.Model.Db.Hr;


namespace HengTong.ViewModel.Person.SysPersonFamilyVms
{
    public partial class SysPersonFamilyTemplateVm : BaseTemplateVM
    {
        [Display(Name = "员工")]
        public ExcelPropety PersonExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.PersonId);
        [Display(Name = "家属姓名")]
        public ExcelPropety MemberNameExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.MemberName);
        [Display(Name = "民族")]
        public ExcelPropety EthnicityExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.Ethnicity);
        [Display(Name = "家属出生日期")]
        public ExcelPropety BirthDateExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.BirthDate);
        [Display(Name = "工作单位/就读学校")]
        public ExcelPropety WorkOrSchoolExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.WorkOrSchool);
        [Display(Name = "职位/年级信息")]
        public ExcelPropety JobOrGradeExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.JobOrGrade);
        [Display(Name = "家属联系电话")]
        public ExcelPropety ContactPhoneExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.ContactPhone);
        [Display(Name = "亲属关系类型")]
        public ExcelPropety RelationshipTypeExcel = ExcelPropety.CreateProperty<SysPersonFamily>(x => x.RelationshipType);

	    protected override void InitVM()
        {
            PersonExcel.DataType = ColumnDataType.ComboBox;
            PersonExcel.ListItems = DC.Set<SysPerson>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysPersonFamilyImportVm : BaseImportVM<SysPersonFamilyTemplateVm, SysPersonFamily>
    {

    }

}
